﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using TaskManagement.ModelLayer;

namespace TaskManagement.WcfServiceLibrary
{
   
    [ServiceContract]
    public interface ITaskService
    {
        [OperationContract]
        [WebGet]
        string GetData(int value);

        #region Tasks
        [OperationContract]
        IList<Task> SearchTasks(Task t);

        [OperationContract]
        [WebGet]
        /// <summary>
        /// Searches using the supplied data, not all values must be supplied
        /// Use for rest only
        /// </summary>
        /// <param name="id">The id of the task</param>
        /// <param name="description">Description of the task</param>
        /// <param name="account">Account of the task</param>
        /// <param name="delivery">Delivery of the task</param>
        /// <param name="tag">Tag of the task</param>
        /// <param name="date">Date of the task as a datetime</param>
        /// <param name="status">Status of the task</param>
        /// <param name="estimate">Estimate of the task, must be one greather than the actural value</param>
        /// <param name="timespent">Timespent of the task, must be one greather than the actural value</param>
        /// <param name="employeeid">Id of the employee the task belongs to, must be one greather than the actural value</param>
        /// <returns>A list of tasks matching the search or and empty list</returns>
        IList<Task> SearchTasksRest(int id, string description, string account, string delivery, string tag,
            DateTime date, string status, int estimate, int timespent, int employeeid);
        
        [OperationContract]
        int CreateTask(Task task);
        
        [OperationContract]
        [WebGet]
        int CreateTaskRest(string description, string account, string delivery, string tag,
            DateTime date, string status, int estimate, int timespent);

        [OperationContract]
        int DeleteTasks(IList<Task> tasks);

        [OperationContract]
        [WebGet]
        int DeleteTaskRest(int id);

        [OperationContract]
        int UpdateTask(Task task);

        [OperationContract]
        [WebGet]
        int UpdateTaskRest(int id, string description, string account, string delivery, string tag,
            DateTime date, string status, int estimate, int timespent);

        #endregion

    }


}
